package com.aplink.generic.autosync;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class SyncService extends Service {
	private static SyncAdapter sSyncAdapter = null;
	private static final Object sSyncAdapterLock = new Object();

	@Override
	public IBinder onBind(final Intent intent) {
		return SyncService.sSyncAdapter.getSyncAdapterBinder();
	}

	@Override
	public void onCreate() {
		super.onCreate();
		synchronized (SyncService.sSyncAdapterLock) {
			if (SyncService.sSyncAdapter == null) {
				SyncService.sSyncAdapter = new SyncAdapter(
						getApplicationContext(), true);
			}
		}
	}

}
